<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul>li{
            height: 50px;
            width: 200px;
            background-color: pink;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div id='app'>
        <ul>
            <button @click='changle'>修改长度</button>
            <li v-for='(item,index) in arr':key="index" @click='change(index)'>{{item}}</li>
        </ul>
    </div>
</body> 
<script src="./vue.js"></script>
<script>
    const vm=new Vue({
        el:'#app',
        data:{
            arr:[1,2,3,4]
        },
        methods:{
            change(index){
                this.$set(this.arr,index,1000)
                console.log(this.arr)
                // console.log(index)
            },
            changle(){
                this.arr.pop()
                console.log(this.arr)
            }
        }
    })
</script>
</html>